package com.cskaoyan.controller.mall;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.bean.vo.mall.AdministrativeRegionListEntityVo;
import com.cskaoyan.service.mall.AdministrativeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("admin/region")
public class AdministrativeController {

    @Autowired
    AdministrativeService administrativeService;

    @RequestMapping("list")
    public BaseRespVo regionPage() {
        CommonData<AdministrativeRegionListEntityVo> commonData = administrativeService.queryRegionPage();
        if (commonData == null) {
            return BaseRespVo.invalidData();
        }
        return BaseRespVo.succeed(commonData);
    }
}
